package org.sidora.strata.context.types;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.openide.windows.TopComponent;


/**
 * Action which shows Devasted component
 * @author Enric Tartera, Juan Manuel Gimeno, Roger Masgoret
 * @version 1.0
 */
public class DevastedAction extends AbstractAction {
    
    public DevastedAction() {
        super(NbBundle.getMessage(DevastedAction.class, "CTL_DevastedAction"));
//        putValue(SMALL_ICON, new ImageIcon(Utilities.loadImage(DevastedTopComponent.ICON_PATH, true)));
    }
    
    public void actionPerformed(ActionEvent evt) {
        TopComponent win = DevastedTopComponent.findInstance();
        win.open();
        win.requestActive();
    }
        public void actionPerformed() {
        DevastedTopComponent win = DevastedTopComponent.findInstance();
        win.open();
        win.requestActive();
        win.fillItems();
    }
        
        public void cerrar(){
        DevastedTopComponent win = DevastedTopComponent.findInstance();
        win.close();
        }
}
